package com.winenine999.generator.dao;

import com.winenine999.model.Syorg;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface SyorgMapper {
    @Delete({
        "delete from syorg",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into syorg (id, name, ",
        "seq, pid, orgdetail)",
        "values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, ",
        "#{seq,jdbcType=INTEGER}, #{pid,jdbcType=INTEGER}, #{orgdetail,jdbcType=VARCHAR})"
    })
    int insert(Syorg record);

    int insertSelective(Syorg record);

    @Select({
        "select",
        "id, name, seq, pid, orgdetail",
        "from syorg",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("com.winenine999.generator.dao.SyorgMapper.BaseResultMap")
    Syorg selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Syorg record);

    @Update({
        "update syorg",
        "set name = #{name,jdbcType=VARCHAR},",
          "seq = #{seq,jdbcType=INTEGER},",
          "pid = #{pid,jdbcType=INTEGER},",
          "orgdetail = #{orgdetail,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Syorg record);
}